﻿package net.wangit.jdbc.table;


import java.util.Iterator;

import net.wangit.jdbc.database.Database;

public class UniqueKey extends Constraint {
	public String sqlConstraintString(Database database) {
		StringBuffer buf = new StringBuffer(" unique (");
		Iterator<Column> iter = getColumns().iterator();
		while (iter.hasNext()) {
			buf.append((iter.next()).getQuotedName(database));
			if (iter.hasNext())
				buf.append(", ");
		}
		return ")";
	}
}